<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>店铺管理</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" href="/css/modules.css" type="text/css"	media="screen" />
	<link rel="stylesheet" href="/css/modules1.css" type="text/css"	media="screen" />
	<link rel="stylesheet" href="/css/jquery-ui.css" type="text/css"	media="screen" />
	<link rel="stylesheet" href="/css/jquery.wysiwyg.css" type="text/css"	media="screen" />
	<style type="text/css">
		label{
			display:inline;
		}
		.input-medium{
			width:180px;
		}
	</style>
	<script type='text/javascript' src="/js/jquery-1.4.2.min.js"></script>	
	<script type='text/javascript' src="/js/jquery.js"></script>
	<script type='text/javascript' src="/js/jquery-ui.js"></script>
	<script type='text/javascript' src="/js/jquery.wysiwyg.js"></script>
	<script type='text/javascript' src="/js/custom.js"></script>
	<script type='text/javascript'>
		$(function(){
			$("#provincespan").load("/area/province!getProvince.action");
		});
		function loadCity(f){
			var provinceid=$(f).val();
			$("#cityspan").load("/area/province!getCity.action?provinceid='"+provinceid+"'");
			$("#regionspan").html("");
			$(f).attr("name","province.id");
		//	$("#psel").attr("name","ff.dd");
		}
		
		function loadRegion(f){
			var cityid=$(f).val();
			$("#regionspan").load("/area/province!getRegion.action?cityid='"+cityid+"'");
			$("#psel").attr("name","");
			$(f).attr("name","province.id");
		//	$("#csel").attr("name","");
		}

		function zz(f){
			
			$("#csel").attr("name","");
			$(f).attr("name","province.id");
		//	$("#csel").attr("name","");
		}
	
	
	
		var url;
		var dialogOption={height: 400,width:880,modal:true,position: [0,50]};
		function addPro(){
			jQuery("#addProduct").dialog(dialogOption);
			jQuery("#addProduct").dialog("open");
		}
		function findRecordByPid(pid){
			url="/RecordAction!findRecord.action?product.id="+pid;
			$("#getRecord").load(url,function(){
				jQuery("#getRecord").dialog();
				jQuery("#getRecord").dialog("open");
			});
			
		}
		function purchase(operate,pid){
			url="/ProductAction!getProduct.action?productid="+pid+"&operate="+operate;
			$("#purchase").load(url,function(){
				jQuery("#purchase").dialog();
				jQuery("#purchase").dialog("open");
			});
		}
		
		function editProduct(pid){
			url="/ProductAction!edit.action?productid="+pid;
			$("#editProduct form").load(url,function(){
				jQuery("#editProduct").dialog(dialogOption);
				jQuery("#editProduct").dialog("open");
			});
		}
	</script>
  </head>
  
<body style="background-color:transparent">
	<!--  Goods_list header -->
	<div style="padding:10px;">
  		<h2 class="jquery_tab_title">店铺列表
  			<span style="float:right;">
  				<input type="text" class="input-medium" value="请输入货物编号/名称/类型" />
  				<input type="button" value="Search" class="button" />
  				<a href="##">高级查询</a>
  			</span>
  		</h2>
  		<input type="button" style="margin:10px;" value="+创建店铺" class="button" onclick="addPro();" />
  	</div>
  	<!--  Goods_list  -->
  	<div>
  		<table width="100%" cellpadding="0" cellspacing="0">
   			<tr><th class="th_first">&nbsp;</th><th>店铺名称</th><th>店长</th><th>联系电话</th>
   			<th>地址</th><th>创建人</th><th>时间</th><th>操作</th></tr>
   		<s:iterator value="outletsList">
    		<tr>
    			<td class="td_first">
    				<input type="checkbox" />
    				<input type="hidden" id="pid" value="${id}" />
    			</td>
    			<td>${name }&nbsp;</td>
    			<td>
    				${manager.realname }&nbsp;
    			</td>
    			<td>${telphone }&nbsp;</td>
    			<td>${province.fullAddress }${address }&nbsp;</td>
    			<td>${creater.realname }&nbsp;</td>
    			<td><s:date name="date" format="yy/MM/dd HH:mm" ></s:date>&nbsp;</td>
    			<td>
    			<a href="#">管理</a>/
    			<a href="/OutletsAction!del.action?id=${id }">删除</a>
    			</td>
    		</tr>
    	</s:iterator>
    	</table>
  	</div>
   	<div style="padding:10px;">
   		<span style="float:left">
   		<!-- 
   			<input type="button" value="选中全部" class="button" />
   			<input type="button" value="批量删除" class="button"/>
   		 -->
   			
   		</span>
   		<span style="float:right">
   			<s:property value="#request.pagination" escape="false" />
   		</span>
   	</div>
   	
   	<!--  addGoods dialog  -->
	<div id="addProduct" style="display:none;" title="快速新建店铺">
 		<s:form action="OutletsAction!save.action" method="post">
 			<s:include value="/WEB-INF/page/product/outlets_add.jsp" />
 		</s:form>
 	</div>
 	<!--  editGoods dialog  -->
	 
	<div id="editProduct" style="display:none;" title="修改货品">
		<s:form action="ProductAction!update.action" method="post"></s:form>
	</div> 
 	<!--  purchase dialog  -->
 	
  	<div id="purchase" style="display:none;" title="进出货物"></div>
  	
  	
  	<!--------------------------------------------
  				弹出层查看商品交易记录(隐藏) 
   	 ---------------------------------------------->
	<div id="getRecord" style="display:none;width:500px;height:300px;" title="货物进出详单"></div>
  
  </body>
</html>
